package com.speoki.springboot.service;

import com.speoki.springboot.mapper.Student;
import com.speoki.springboot.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
   private  StudentMapper studentMapper ;

    @Override
    public List<Student> getAll() {
        return studentMapper.getAll();
    }

    @Override
    public Integer updateStudent(Student student) {
        return studentMapper.updateByPrimaryKey(student);
    }

    @Override
    public Student queryStudentById(Integer id) {
        Student student = studentMapper.selectByPrimaryKey(id);
   return student;
    }

    @Override
    public List<Student> getPreAndSex(String prename, Integer ssex) {
        return studentMapper.selectByPreAndSex(prename,ssex);
    }
}
